﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGsCullingBSphere : OdGeSphere, OdGsCullingPrimitive
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGsCullingBSphere(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGsCullingBSphere_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGsCullingBSphere obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGsCullingBSphere()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGsCullingBSphere(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		HandleRef OdGsCullingPrimitive.GetCPtr()
		{
			return new HandleRef(this, GlobalsPINVOKE.OdGsCullingBSphere_OdGsCullingPrimitive_GetCPtr(this.swigCPtr.Handle));
		}

		public OdGsCullingBSphere() : this(GlobalsPINVOKE.new_OdGsCullingBSphere__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGsCullingBSphere(double radius, OdGePoint3d center) : this(GlobalsPINVOKE.new_OdGsCullingBSphere__SWIG_1(radius, OdGePoint3d.getCPtr(center)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGsCullingBSphere(OdGeSphere sphere) : this(GlobalsPINVOKE.new_OdGsCullingBSphere__SWIG_2(OdGeSphere.getCPtr(sphere)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGsCullingBSphere(OdGsCullingBSphere bsphere) : this(GlobalsPINVOKE.new_OdGsCullingBSphere__SWIG_3(OdGsCullingBSphere.getCPtr(bsphere)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new OdGsCullingBSphere Assign(OdGeSphere sphere)
		{
			OdGsCullingBSphere result = new OdGsCullingBSphere(GlobalsPINVOKE.OdGsCullingBSphere_Assign__SWIG_0(this.swigCPtr, OdGeSphere.getCPtr(sphere)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGsCullingBSphere Assign(OdGsCullingBSphere bsphere)
		{
			OdGsCullingBSphere result = new OdGsCullingBSphere(GlobalsPINVOKE.OdGsCullingBSphere_Assign__SWIG_1(this.swigCPtr, OdGsCullingBSphere.getCPtr(bsphere)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGsCullingPrimitiveImpl.PrimitiveType primitiveType()
		{
			OdGsCullingPrimitiveImpl.PrimitiveType result = (OdGsCullingPrimitiveImpl.PrimitiveType)GlobalsPINVOKE.OdGsCullingBSphere_primitiveType(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
